@import '~components/constants.scss';

.workspace {
  width: 100%;
  margin-bottom: 24px;
  position: relative;
  transition: top 0.2s, height 0.2s, opacity 0.2s;
  cursor: pointer;

  .image {
    transition: background 0.2s;
  }
  .name {
    transition: color 0.2s;
  }

  &:hover,
  &.is_selected {
    .image {
      background-color: $white;
    }
    .name {
      color: $white;
    }
    &::after {
      background: $white;
    }
  }

  .notification_dot {
    position: absolute;
    top: -8px;
    left: calc(50% + 8px);
    background: $red;
    width: 16px;
    height: 16px;
    border: 2px solid $secondary;
    box-sizing: border-box;
    border-radius: 50%;
  }

  //Selector left indicator
  &::after {
    content: '';
    width: 4px;
    border-radius: 0 2px 2px 0;
    height: 4px;
    top: 14px;
    position: absolute;
    left: 0px;
    background: $grey_dark;
    opacity: 0;
    transition: top 0.2s, height 0.2s, background 0.2s;
  }
  &.is_selected {
    &::after {
      height: 32px !important;
      top: 0px !important;
      opacity: 1;
      background: $white;
    }
  }
  &.has_notifications {
    &::after {
      height: 8px;
      top: 12px;
      opacity: 1;
      border-radius: 0 4px 4px 0;
    }
  }

  .image {
    background-color: $grey_dark;
    background-size: cover;
    background-position: center;
    color: $secondary;
    font-size: 14px;
    text-align: center;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: $larger_border_radius;
    margin: auto;
    margin-bottom: 8px;
    background-size: cover;
    background-position: center;
    font-weight: 500;
    overflow: visible;

    &.has_image {
      font-size: 0px;
    }
  }

  .name {
    color: $grey_dark;
    opacity: 1;
    text-align: center;
    font-size: 12px;
    height: 16px;
    margin-right: 5%;
    margin-left: 5%;
    font-weight: 500;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    text-transform: capitalize;
  }

  &.workspaceadd {
    .image {
      padding-top: 8px;
      box-sizing: border-box;
      line-height: normal;
    }
  }
}

.loading_render {
  .workspace {
    pointer-events: none;
    &::after,
    .notification_dot {
      opacity: 0 !important;
    }
    .image {
      font-size: 0px;
      background: $grey_dark !important;
    }
    .name {
      background: $grey_dark;
      border-radius: var(--default-border-radius-large);
      width: 32px;
      margin: auto;
      height: 12px;
      font-size: 0px;
      margin-bottom: 28px;
    }
    &.workspaceadd {
      display: none;
    }
  }
}
